import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import Writing from '@/views/Writing.vue'
import Community from '@/views/Community.vue'
import Drafts from '@/views/Drafts.vue'
import Bookmarks from '@/views/Bookmarks.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: Home,
      children: [
        {
          path: '',
          redirect: '/writing'
        },
        {
          path: '/writing',
          component: Writing
        },
        {
          path: '/community',
          component: Community
        },
        {
          path: '/drafts',
          component: Drafts
        },
        {
          path: '/bookmarks',
          component: Bookmarks
        }
      ]
    }
  ]
})

export default router
